import request from '@/utils/request'

/* 登录*/
export function login(data) {
    return request({
        /* url: '/vue-element-admin/user/login',*/
        url: '/api/UserInfoAction/login',
        method: 'post',
        data
    })
}
/* 获取用户信息 */
export function getInfo(username) {
    return request({
        /* url: '/vue-element-admin/user/info',*/
        url: '/api/UserInfoAction/loginSuccess',
        method: 'get',
        params: { username }
    })
}
export function getUserInfo(userId) {
    return request({
        url: '/api/UserInfoAction/getUserInfoById',
        method: 'get',
        params: { userId }
    })
}

/* 修改密码*/
export function changePwd(obj) {
    return request({
        url: '/api/UserInfoAction/updatePassword',
        method: 'get',
        params: { ...obj }
    })
}
/* 注销*/
export function logout() {
    return request({
        url: '/api/UserInfoAction/logout',
        method: 'post'
    })
}
/* 获取菜单*/
export function getMenu(token) {
    return request({
        url: '/api/MenuInfoAction/initLeftList',
        method: 'get',
        params: { token }
    })
}
